/******/ (function(modules) { // webpackBootstrap
/******/ 	// The module cache
/******/ 	var installedModules = {};

/******/ 	// The require function
/******/ 	function __webpack_require__(moduleId) {

/******/ 		// Check if module is in cache
/******/ 		if(installedModules[moduleId])
/******/ 			return installedModules[moduleId].exports;

/******/ 		// Create a new module (and put it into the cache)
/******/ 		var module = installedModules[moduleId] = {
/******/ 			exports: {},
/******/ 			id: moduleId,
/******/ 			loaded: false
/******/ 		};

/******/ 		// Execute the module function
/******/ 		modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);

/******/ 		// Flag the module as loaded
/******/ 		module.loaded = true;

/******/ 		// Return the exports of the module
/******/ 		return module.exports;
/******/ 	}


/******/ 	// expose the modules object (__webpack_modules__)
/******/ 	__webpack_require__.m = modules;

/******/ 	// expose the module cache
/******/ 	__webpack_require__.c = installedModules;

/******/ 	// __webpack_public_path__
/******/ 	__webpack_require__.p = "";

/******/ 	// Load entry module and return exports
/******/ 	return __webpack_require__(0);
/******/ })
/************************************************************************/
/******/ ([
/* 0 */
/***/ function(module, exports, __webpack_require__) {

	"use strict";
	__webpack_require__(6);


/***/ },
/* 1 */,
/* 2 */,
/* 3 */
/***/ function(module, exports, __webpack_require__) {

	"use strict";
	/// <reference path="../declare/dec.d.ts"/>
	var route_ts_1 = __webpack_require__(4);
	function getAction(action) {
	    return {
	        url: (route_ts_1.routeConfig.domain + route_ts_1.routeConfig.path) + "/" + action,
	        post: function (data, callback) {
	            $.ajax({
	                url: this.url,
	                type: 'post',
	                data: data,
	                success: callback.success,
	                error: callback.error
	            });
	        }
	    };
	}
	Object.defineProperty(exports, "__esModule", { value: true });
	exports.default = getAction;
	function getActionOfImportPhone(action) {
	    return {
	        url: (route_ts_1.routeConfig.domain + route_ts_1.routeConfig.path) + "/" + action,
	        post: function (data, callback) {
	            $.ajax({
	                url: this.url,
	                type: 'post',
	                processData: false,
	                data: data,
	                contentType: false,
	                success: callback.success,
	                error: callback.error
	            });
	        }
	    };
	}
	exports.getActionOfImportPhone = getActionOfImportPhone;


/***/ },
/* 4 */
/***/ function(module, exports) {

	"use strict";
	exports.routeConfig = {
	    domain: 'http://m.sz404.com',
	    path: '/api'
	};


/***/ },
/* 5 */,
/* 6 */
/***/ function(module, exports, __webpack_require__) {

	/// <reference path="../declare/dec.d.ts"/>
	"use strict";
	var action_ts_1 = __webpack_require__(3);
	var loginAction = action_ts_1.default('userlogin');
	$('#stage').css('height', window.innerHeight);
	(function () {
	    var username = localStorage.getItem('sgm_remember_username');
	    var password = localStorage.getItem('sgm_remember_password');
	    if (username && password) {
	        $('#username').val(username);
	        $('#password').val(password);
	        $('#remember-me').prop('checked', true);
	    }
	})();
	/*登录*/
	$('#login').on('click', function () {
	    var username = $('#username').val();
	    var password = $("#password").val();
	    loginAction.post({
	        username: username,
	        password: password
	    }, {
	        success: function (data) {
	            if (data.code == 0) {
	                /*记住密码*/
	                remember(username, password);
	                localStorage.setItem('sgm_chart_session', data.sessionid);
	                /*$.ajax({
	                    url: 'http://m.sz404.com/api/getprovince',
	                    type: 'post',
	                    data: {
	                        sessionid: data.sessionid
	                    },
	                    success(data) {
	                        if (data.code == 0) {
	                            for (let province of data.provinces) {
	                                $('.select-province').append(`<option value=${province.id}>${province.name}</option>`)
	                            }
	                        }
	                    },
	                    error() { }
	                })*/
	                $('input[name="sessionid"]').val(data.sessionid);
	                if (data.import_count !== 0) {
	                    $('#already-upload').modal({
	                        show: true,
	                        backdrop: 'static'
	                    });
	                }
	                else {
	                    $('#not-upload').modal({
	                        show: true,
	                        backdrop: 'static'
	                    });
	                }
	            }
	            else {
	                alert(data.message);
	            }
	        },
	        error: function () {
	        }
	    });
	});
	function remember(username, password) {
	    localStorage.setItem('sgm_remember_username', username);
	    if ($('#remember-me').prop('checked')) {
	        localStorage.setItem('sgm_remember_password', password);
	    }
	    else {
	        localStorage.removeItem('sgm_remember_password');
	    }
	}
	var uploadAction = action_ts_1.getActionOfImportPhone('importphone');
	$('#upload-go').click(function () {
	    var formdata = new FormData(document.getElementById('upload-form'));
	    uploadAction.post(formdata, {
	        success: function (data) {
	            if (data.code === 0) {
	                location.assign('chart.html');
	            }
	            else {
	                alert('上传失败');
	            }
	        },
	        error: function () {
	            alert('上传失败');
	        }
	    });
	});
	$('#upload-go-2').click(function () {
	    var formdata = new FormData(document.getElementById('upload-form-2'));
	    uploadAction.post(formdata, {
	        success: function (data) {
	            if (data.code === 0) {
	                location.assign('chart.html');
	            }
	            else {
	                alert('上传失败');
	            }
	        },
	        error: function () {
	            alert('上传失败');
	        }
	    });
	});


/***/ }
/******/ ]);